<%@page import="pro.syj.bean.Score"%>
<%@page import="pro.syj.dao.ScoreDao"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>成绩修改</title>
	<link rel='stylesheet' href='CSS/decorator1.css'>
</head>

<body>
	<h1>学生成绩修改</h1>
	<hr>
	<%
	    String cid = request.getParameter("cid");
	    String sid = request.getParameter("sid");
	    ScoreDao scoredao = new ScoreDao();
	    Score score = new Score();
	    score = scoredao.selectOne2(sid, cid);
	%>
	<form action="managerUscore-do.jsp" method="post" name="updateForm">
	<br>
	<div>
		<label>课程编号：</label>
		<input type="text" name="cid" value="<%=score.getCid() %>" disabled>
	</div><br>
	<div>
		<label>课程名：</label>
		<input type="text" name="cname" value="<%=score.getCname() %>" disabled>
	</div><br>
	<div>
		<label>学号：</label>
		<input type="text" name="sid" value="<%=score.getSid() %>" disabled>
	</div><br>
	<div>
		<label>姓名：</label>
		<input type="text" name="sname" value="<%=score.getSname() %>" disabled>
	</div><br>
	<div>
		<label>平时成绩：</label>
	   <input type="text" name="score1" value="<%=score.getScore1() %>">
	</div><br>
	<div>
		<label>考试成绩：</label>
	   <input type="text" name="score2" value="<%=score.getScore2() %>">
	</div><br>
	<div>
		<button type="submit" onclick="return checkForm()">确认修改</button>
		<button type="reset">重置</button>
	</div><br>
	<div>
		<a href="javascript: window.history.go(-1)">  [返回上一级]</a>
		<a href="managerMain.jsp">[返回主界面]</a>
		</div>
	</form>
	
	<script type="text/javascript">
    function checkForm() {
        var score1 = updateForm.score1.value;
        var score2 = updateForm.score2.value;
        //alert(name + pwd + repwd);
        if (score1 == "" || score1 == null) {
            alert("修改值不能为空！");
            updateForm.score1.focus();
            return false;
        } else if (score2 == "" || score2 == null) {
            alert("修改值不能为空！");
            updateForm.score2.focus();
            return false;
        }else if(score1 > 100 || score1 < 0 ){
        	alert("修改值不合法！");
        	updateForm.score1.focus();
        	return false;
        }else if(score2 > 100 || score2 < 0 ){
        	alert("修改值不合法！");
        	updateForm.score2.focus();
        	return false;
        }
        alert('正在提交......');
        return true;
    }
	</script>
</body>
</html>



















